﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlantCheck : MonoBehaviour
{
    private void OnTriggerStay2D(Collider2D other)  //碰到触发器
    {
        if (other.gameObject.name =="Player")
        {
            other.GetComponent<Player>().canPlant = false;
        }
    }
    private void OnTriggerExit2D(Collider2D other)  //碰到触发器
    {
        if (other.gameObject.name == "Player")
        {
            other.GetComponent<Player>().canPlant = true;
        }
    }
}
